package cn.xhjava.crm.workbench.controller.chat;

import cn.xhjava.crm.workbench.domain.DateDataMapVO;
import cn.xhjava.crm.workbench.domain.FunnelVO;
import cn.xhjava.crm.workbench.service.ActivityService;
import cn.xhjava.crm.workbench.service.ClueService;
import cn.xhjava.crm.workbench.service.TranService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

@Controller
public class ClueChartController {
    @Autowired
    private ClueService clueService;

    @RequestMapping("/workbench/chart/clue/index")
    public String clueIndex() {
        return "workbench/chart/clue/index";
    }

    @RequestMapping("/workbench/chart/clue/queryCountGroupByCreateTime")
    public @ResponseBody
    Object queryMoneyCountGroupByCreateTime() throws Exception {
        DateDataMapVO dateDataMapVO = clueService.queryClueCountGroupByCreateTime();
        return dateDataMapVO;
    }


    @RequestMapping("/workbench/chart/clue/queryCountGroupBySource")
    public @ResponseBody
    Object queryClueCountGroupBySource() throws Exception {
        List<FunnelVO> res = clueService.queryClueCountGroupBySource();
        return res;
    }

    @RequestMapping("/workbench/chart/clue/queryCountGroupByState")
    public @ResponseBody
    Object queryClueCountGroupByState() throws Exception {
        List<FunnelVO> res = clueService.queryClueCountGroupByState();
        return res;
    }


}
